<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader: Otfad</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Common bootloader for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__otfad.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Otfad</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structotfad__kek__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#structotfad__kek__t">otfad_kek_t</a></td></tr>
<tr class="memdesc:structotfad__kek__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Format of OTFAD key wrap key (KEK).  <a href="group__otfad.html#structotfad__kek__t">More...</a><br /></td></tr>
<tr class="separator:structotfad__kek__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structkeyblob__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#structkeyblob__t">keyblob_t</a></td></tr>
<tr class="memdesc:structkeyblob__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Key Blob format.  <a href="group__otfad.html#structkeyblob__t">More...</a><br /></td></tr>
<tr class="separator:structkeyblob__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structkeyblob__data__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#structkeyblob__data__t">keyblob_data_t</a></td></tr>
<tr class="separator:structkeyblob__data__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga9ccaabd10a0589a6eddce32a8d830f0d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9ccaabd10a0589a6eddce32a8d830f0d"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#ga9ccaabd10a0589a6eddce32a8d830f0d">_otfad_driver_errors</a> { <br />
&#160;&#160;<b>kStatus_OtfadSecurityViolation</b> = MAKE_STATUS(kStatusGroup_OTFADDriver, 0), 
<br />
&#160;&#160;<b>kStatus_OtfadLogicallyDisabled</b> = MAKE_STATUS(kStatusGroup_OTFADDriver, 1), 
<br />
&#160;&#160;<b>kStatus_OtfadInvalidKey</b> = MAKE_STATUS(kStatusGroup_OTFADDriver, 2), 
<br />
&#160;&#160;<b>kStatus_OtfadInvalidKeyBlob</b> = MAKE_STATUS(kStatusGroup_OTFADDriver, 3)
<br />
 }<tr class="memdesc:ga9ccaabd10a0589a6eddce32a8d830f0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">OTFAD Driver status codes. <br /></td></tr>
</td></tr>
<tr class="separator:ga9ccaabd10a0589a6eddce32a8d830f0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab487d9de6657e52b333aef26e83528b"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#gaab487d9de6657e52b333aef26e83528b">_constants</a> { <br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba980a0b43bccb177a246496697357a59f">kAesKeySizeBytes</a> = 16, 
<br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba0ec35a4001e2a954f41248873d0d563b">kCtrSizeBytes</a> = 8, 
<br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba4cd539cd580609f89c747e70626de60d">kCrc32SizeBytes</a> = 32, 
<br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba3fa042ac9d671c5dd26f50c105106127">kNumKeyBlobs</a> = 4, 
<br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba8558ee41e7d5b3d20f164d648e0bdef5">kKeyBlobSizeBytes</a> = 64, 
<br />
&#160;&#160;<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528bae16bf8c9a0bd0071e956409243e48aaa">kKeyBlobArraySizeBytes</a> = kKeyBlobSizeBytes * kNumKeyBlobs
<br />
 }<tr class="memdesc:gaab487d9de6657e52b333aef26e83528b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constants.  <a href="group__otfad.html#gaab487d9de6657e52b333aef26e83528b">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gaab487d9de6657e52b333aef26e83528b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gabc5e2cd3ad225e64ec0d26c738d06ff9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#gabc5e2cd3ad225e64ec0d26c738d06ff9">otfad_init</a> (uint32_t instance, const uint8_t *keyBlobs, const <a class="el" href="group__otfad.html#structotfad__kek__t">otfad_kek_t</a> *kek)</td></tr>
<tr class="memdesc:gabc5e2cd3ad225e64ec0d26c738d06ff9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize.  <a href="#gabc5e2cd3ad225e64ec0d26c738d06ff9">More...</a><br /></td></tr>
<tr class="separator:gabc5e2cd3ad225e64ec0d26c738d06ff9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac31db617051a8de34e528fd76b38eabe"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#gac31db617051a8de34e528fd76b38eabe">program_contexts</a> (OTFAD_Type *baseAddr, uint8_t *keyBlobs, uint32_t *kek)</td></tr>
<tr class="memdesc:gac31db617051a8de34e528fd76b38eabe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Program context regiters with information from key blobs.  <a href="#gac31db617051a8de34e528fd76b38eabe">More...</a><br /></td></tr>
<tr class="separator:gac31db617051a8de34e528fd76b38eabe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga64a33896b818cad60f17be77e2e33987"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#ga64a33896b818cad60f17be77e2e33987">validate_crc</a> (const <a class="el" href="group__otfad.html#structkeyblob__t">keyblob_t</a> *keyBlob)</td></tr>
<tr class="memdesc:ga64a33896b818cad60f17be77e2e33987"><td class="mdescLeft">&#160;</td><td class="mdescRight">Validate CRC32 in key blob.  <a href="#ga64a33896b818cad60f17be77e2e33987">More...</a><br /></td></tr>
<tr class="separator:ga64a33896b818cad60f17be77e2e33987"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:gaf41cc423311c5c895feca39f029e9bad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf41cc423311c5c895feca39f029e9bad"></a>
const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otfad.html#gaf41cc423311c5c895feca39f029e9bad">g_otfadBaseAddr</a> [] = OTFAD_BASE_ADDRS</td></tr>
<tr class="memdesc:gaf41cc423311c5c895feca39f029e9bad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Instance base addresses. <br /></td></tr>
<tr class="separator:gaf41cc423311c5c895feca39f029e9bad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Usage Information</h2>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structotfad__kek__t" id="structotfad__kek__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct otfad_kek_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Format of OTFAD key wrap key (KEK). </p>
<p>The four consecutive little-endian memory-mapped registers provide 128 bits of key storage. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a95c1e7145d203e27f75f85e363e575e8"></a>uint32_t</td>
<td class="fieldname">
keyWord0</td>
<td class="fielddoc">
Word0: KEY[31:0][A03, A02, A01, A00]. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a7bf2cb34d45af9edb8c0558a8e76c1ae"></a>uint32_t</td>
<td class="fieldname">
keyWord1</td>
<td class="fielddoc">
Word1: KEY[31:0][A07, A06, A05, A04]. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a04734659291e20efea5d58d4ad42d9a1"></a>uint32_t</td>
<td class="fieldname">
keyWord2</td>
<td class="fielddoc">
Word2: KEY[31:0][A11, A10, A09, A08]. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a59b01c9f83f064b79b3fa06e5e9f5883"></a>uint32_t</td>
<td class="fieldname">
keyWord3</td>
<td class="fielddoc">
Word3: KEY[31:0][A15, A14, A13, A12]. </td></tr>
</table>

</div>
</div>
<a name="structkeyblob__t" id="structkeyblob__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct keyblob_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Key Blob format. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a823cf56f8e2363d5f4963323e5b06194"></a>uint8_t</td>
<td class="fieldname">
ctr[<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba0ec35a4001e2a954f41248873d0d563b">kCtrSizeBytes</a>]</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a00ccf1e11b13f766471ab83b96523046"></a>uint32_t</td>
<td class="fieldname">
endaddr</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1d374a2fcbef6835ef056e854bf1b595"></a>uint8_t</td>
<td class="fieldname">
expanded_wrap_data[8]</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a4fb8b081c2e08db522def000c6ad6811"></a>uint8_t</td>
<td class="fieldname">
key[<a class="el" href="group__otfad.html#ggaab487d9de6657e52b333aef26e83528ba980a0b43bccb177a246496697357a59f">kAesKeySizeBytes</a>]</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a76fa83556cfb051dc6909eebb6df5bc5"></a>uint32_t</td>
<td class="fieldname">
key_blob_crc32</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a266aed2ecca97378af3a33b2c25a4bd4"></a>uint32_t</td>
<td class="fieldname">
srtaddr</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ac4144a8ef0214ee66504c4d0213cabaf"></a>uint8_t</td>
<td class="fieldname">
unused_filler[16]</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a27c88c07c4c3a61738c46a67ba8f4c11"></a>uint32_t</td>
<td class="fieldname">
zero_fill</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<a name="structkeyblob__data__t" id="structkeyblob__data__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct keyblob_data_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"></div><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for keyblob_data_t:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="structkeyblob__data__t__coll__graph.svg" width="122" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a388df6393260060be27940e56c6336bb"></a>uint8_t</td>
<td class="fieldname">
ivHeader[8]</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a82bb2e1c0c5d4c9b1834ed9b56c47fd0"></a><a class="el" href="group__otfad.html#structkeyblob__t">keyblob_t</a></td>
<td class="fieldname">
keyBlob</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gaab487d9de6657e52b333aef26e83528b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__otfad.html#gaab487d9de6657e52b333aef26e83528b">_constants</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constants. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528ba980a0b43bccb177a246496697357a59f"></a>kAesKeySizeBytes&#160;</td><td class="fielddoc">
<p>Number of bytes in AES-128 key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528ba0ec35a4001e2a954f41248873d0d563b"></a>kCtrSizeBytes&#160;</td><td class="fielddoc">
<p>Number of bytes in Ctr. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528ba4cd539cd580609f89c747e70626de60d"></a>kCrc32SizeBytes&#160;</td><td class="fielddoc">
<p>Number of bytes covered by CRC32. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528ba3fa042ac9d671c5dd26f50c105106127"></a>kNumKeyBlobs&#160;</td><td class="fielddoc">
<p>Number of key blobs. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528ba8558ee41e7d5b3d20f164d648e0bdef5"></a>kKeyBlobSizeBytes&#160;</td><td class="fielddoc">
<p>Key blob size in bytes. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaab487d9de6657e52b333aef26e83528bae16bf8c9a0bd0071e956409243e48aaa"></a>kKeyBlobArraySizeBytes&#160;</td><td class="fielddoc">
<p>Key blob array size in bytes. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gabc5e2cd3ad225e64ec0d26c738d06ff9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> otfad_init </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>instance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>keyBlobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__otfad.html#structotfad__kek__t">otfad_kek_t</a> *&#160;</td>
          <td class="paramname"><em>kek</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize. </p>
<p>If OTFAD KEY in the SIM module is invalid, or the key blobs are invalid, then the OTFAD will be initialized to bypass mode (no decryption). Otherwise, keyBlobs will be unwrapped and programmed into the OTFAD context registers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">instance</td><td>Module instance </td></tr>
    <tr><td class="paramname">keyBlobs</td><td>Pointer to array of 4 key blobs </td></tr>
    <tr><td class="paramname">kek</td><td>Pointer to OTFAD Key Encryption Key (KEK) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_OtfadLogicallyDisabled</td><td>OTFAD is disabled </td></tr>
    <tr><td class="paramname">kStatus_OtfadSecurityViolation</td><td>Security violation detectd </td></tr>
    <tr><td class="paramname">kStatus_Success</td><td>OTFAD has been initialized </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac31db617051a8de34e528fd76b38eabe"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void program_contexts </td>
          <td>(</td>
          <td class="paramtype">OTFAD_Type *&#160;</td>
          <td class="paramname"><em>baseAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>keyBlobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>kek</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Program context regiters with information from key blobs. </p>
<p>Key blobs are unwrapped first. Each blob is validated with CRC32.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">baseAddr</td><td>OTFAD module base address </td></tr>
    <tr><td class="paramname">keyBlobs</td><td>pointer to array of 4 key blobs </td></tr>
    <tr><td class="paramname">kek</td><td>KeK words </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga64a33896b818cad60f17be77e2e33987"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool validate_crc </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__otfad.html#structkeyblob__t">keyblob_t</a> *&#160;</td>
          <td class="paramname"><em>keyBlob</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Validate CRC32 in key blob. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keyBlob</td><td>Pointer to key blob </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if CRC matches, False otherwise </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 7 2016 16:48:24 for Kinetis Bootloader by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
